<!DOCTYPE html>

<head>
    <meta charset="UTF-8">
    <style>
        div {
            width: 300px;
            height: 300px;

        }

        #box1 {
            background-color: chocolate;
        }

        #box2 {
            background-color: greenyellow;
        }
    </style>
    <script src="../jQuery-3.6.3.min.js"> </script>
    <script>
        $(function () {
            $("#a1").click(function () {
                $("#box1").animate({ "width": "150px", "height": "150px" }, 1000);
            })
            $("#a2").click(function () {
                $("#box2").animate({ "width": "-=150px", "height": "-=150px" }, 1000)
            })
        })
    </script>
</head>

<body>
    <div id="box1"></div>
    <div id="box2"></div>
    <input type="button" id="a1" value="简单动画">
    <input type="button" id="a2" value="累计动画">
</body>

</html>